{% extends "base.html" %}
{% load nav_extras %}
{% block header%}
<script type="text/javascript">
    var myCalendar;
    function doOnLoad() {
        myCalendar = new dhtmlXCalendarObject([ "dt1", "dt2" ]);
        myCalendar.loadUserLanguage('cn');
    }
</script>
{% endblock%}
{% block content %}
<div class="searchBar">
<form action="{{full_path}}" method="post">
    {% csrf_token %} 起始日期：<input type="text" id="dt1" name="dt1" value="{{dt1|date:'Y-m-d'}}" /> 终止日期：<input type="text" id="dt2"
      name="dt2" value="{{dt2|date:'Y-m-d'}}" /> <input type="submit" value="检索" />

  </form>
  </div>


    <h1>&nbsp;&nbsp;{%if who %}{{who}}{%else%}{% if '/checkin/dept' in full_path %}{{my_dept.name}}{%else%}{% if '/checkin/branch/' in full_path %}{{dept.name}}{%else%}我{%endif%}{%endif%}的考勤{%endif%}</h1>
    <br/>
    <div class="pageContent">
    <table class="dhtmlxGrid" gridHeight="auto" name="grid2" imgpath="/static/js/codebase/imgs/" width="98%" lightnavigation="true" >
          <tr>
            <!-- <th style="width: 100px; cursor: default; ">编号</th> -->
            {% if '/checkin/dept' in full_path or '/checkin/branch/' in full_path  or '/checkin/absence/dept' in full_path %}
            <td type="ro">姓名</td>
            {%endif%}
            <td type="ro">日期</td>
            <td type="ro">签到时间</td>
            <td type="ro">签退时间</td>
            <td type="ro">编辑人</td>
          <!-- mincat @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
            <th>上班时间</th>
            <th>下班时间</th>
            <th>签到时间</th>
            <th>签退时间</th>
            <th>考勤状态(正常/请假/异常)</th>
          -->
          </tr>
          {%for log in list.object_list%}
          <tr>
            {% if '/checkin/dept' in full_path or '/checkin/branch/' in full_path  or '/checkin/absence/dept' in full_path %}
            <td>{{log.user.last_name}}</td>
            {%endif%}
            <td>{{log.created_date|date:"Y-m-d"}}</td>
            <td>{% if log.first_login_time %}{{log.first_login_time}}{%endif%}</td>
            <td>{% if log.last_logout_time %}{{log.last_logout_time}}{%endif%}</td>
            <td>{% if log.edited_by_id %}{{log.edited_by.username}}{%endif%}</td>
          </tr>
          {%endfor%}
      </table>
    </div>

    <div class="pagination">
  {% paging_nav nav_url pn pc %} 
  </div>
{% endblock %}